home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-02-19 | 3.6 KB | 115 lines | [TEXT/CWIE] |
- /*
- File: GenericSearchSpec.c
-
- Contains: xxx put contents here xxx
-
- Written by: Andy Nicholas, Greg Anderson, Tom Conrad, Chris Bingham, Georgiann Puckett, John Thompson-Rohrlich
-
- Copyright: © 1994-1995 by Apple Computer, Inc., all rights reserved.
-
- <9> 9/18/95 ga
- */
-
- #ifdef MWTRACEBACKTABLES
- #pragma traceback on
- #endif
-
-
- #include "GenericSearchSpec.h"
-
- //
- // A generic search specification needs to be able to make
- // a generic search engine
- //
- //#include "GenericSearchEngine.h"
-
- //
- // AbstractScriptableObject is needed to call the 'CompareProperty' method
- //
- #include "AbstractScriptableObject.h"
-
- //
- // Need definition of comparison operand because we use them to compare
- //
- #include "ComparisonOperand.h"
-
- #include <AEObjects.h>
- #include "AEPackObject.h"
-
- #include "Exceptions.h"
-
- //========================================================================================
- // CLASS TGenericSearchSpec
- //========================================================================================
-
- #pragma segment ObjectResident
- ImplementSmallClassData(TGenericSearchSpec, clGenericSearchSpec);
-
- #pragma segment SearchSpec
-
-
- //----------------------------------------------------------------------------------------
- // TGenericSearchSpec::~TGenericSearchSpec:
- //----------------------------------------------------------------------------------------
- TGenericSearchSpec::~TGenericSearchSpec()
- {
- delete fOperand1;
- delete fOperand2;
- } // TGenericSearchSpec::~TGenericSearchSpec
-
- //----------------------------------------------------------------------------------------
- // TGenericSearchSpec::SpecificationOperator
- //----------------------------------------------------------------------------------------
- DescType TGenericSearchSpec::SpecificationOperator()
- {
- return fComparisonOperator;
- }
-
- //----------------------------------------------------------------------------------------
- // TGenericSearchSpec::Compare:
- //----------------------------------------------------------------------------------------
- Boolean TGenericSearchSpec::Compare(const TAETransaction& t, TAbstractScriptableObject* itemToTest)
- {
- Boolean inSet = fOperand1->Compare(t, fComparisonOperator, *fOperand2, itemToTest);
-
- #ifdef DIAGNOSTICS
- ConditionalDebugPrintf(DEBUGCOPIOUS, "Result of TGenericSearchSpec::Compare is %d", inSet);
- #endif
-
- return inSet;
- } // TGenericSearchSpec::Compare
-
- //----------------------------------------------------------------------------------------
- // TGenericSearchSpec::BuildWhoseTest:
- //----------------------------------------------------------------------------------------
- TDescriptor TGenericSearchSpec::BuildWhoseTest()
- {
- TDescriptor compDescriptor;
- TDescriptor operand1Desc;
- TDescriptor operand2Desc;
-
- operand1Desc = fOperand1->SpecifierForOperand();
- operand2Desc = fOperand2->SpecifierForOperand();
- compDescriptor.MakeCompDescriptor(fComparisonOperator, operand1Desc, operand2Desc, true);
-
- return compDescriptor;
- } // TGenericSearchSpec::BuildWhoseTest
-
-
- //----------------------------------------------------------------------------------------
- // TGenericSearchSpec::GetRightHandComparisonOperand
- //----------------------------------------------------------------------------------------
- TComparisonOperand* TGenericSearchSpec::GetRightHandComparisonOperand()
- {
- return fOperand2;
- }
-
- //----------------------------------------------------------------------------------------
- // TGenericSearchSpec::GetLeftHandComparisonOperand
- //----------------------------------------------------------------------------------------
- TComparisonOperand* TGenericSearchSpec::GetLeftHandComparisonOperand()
- {
- return fOperand1;
- }
-
-